<template>
  <div id="app">
    <Header />
    <!-- 路由组件出口 -->
    <router-view></router-view>
    <!-- 在Home、Search显示的、在登录、注册隐藏 -->
    <!-- <Footer v-show="$route.path == '/home' || $route.path == '/search'" /> -->
    <Footer v-show="$route.meta.show" />
  </div>
</template>

<script>
import Header from './components/Header'
import Footer from './components/Footer'

export default {
  name: 'App',
  components: {
    Header,
    Footer,
  },
  mounted() {
    // 派发一个action，获取商品分类的三级列表向服务器发请求
    this.$store.dispatch('categoryList')
  },
}
</script>

<style></style>
